Add Kubernetes namespace grouping support to Tilt UI#6736
Open
krishnactive wants to merge 2 commits intotilt-dev:masterfrom
Open
Add Kubernetes namespace grouping support to Tilt UI#6736krishnactive wants to merge 2 commits intotilt-dev:masterfrom
krishnactive wants to merge 2 commits intotilt-dev:masterfrom
Conversation
When running 'tilt logs -f <resource>', build event logs from other resources were incorrectly shown in the output. The resource filter check was happening after the build event check, allowing build logs to bypass resource filtering. Solution: Reorder the filter checks in LogFilter.Matches() to apply the resource filter first, before checking for build events. This ensures all logs, including build events, respect the resource filter. Fixes tilt-dev#6663
Contributor
Author
|
@nicks could u review this PR? |
Member
|
don't worry i'll get to it! i want to play with it on a couple projects |
Member
|
hmmm...i wasn't able to reproduce the behavior described in the pr description. the ui functions you added don't appear to be called anywhere? |
krishnactive
added a commit
to krishnactive/tilt
that referenced
this pull request
Apr 19, 2026
…OverviewTable This completes the UI integration for namespace grouping (Issue tilt-dev#6632): UI Components: - Added SidebarGroupedByNamespace component in SidebarResources.tsx for sidebar grouping - Added TableGroupedByNamespace component in OverviewTable.tsx for table grouping - Both components group resources by namespace with "default" namespace shown first - Ungrouped resources (without namespace or Tiltfile) are shown separately SidebarItem Updates: - Added resource property to SidebarItem to enable namespace access during grouping - Allows UI components to extract namespace info directly from UIResource Display Logic: - Namespace grouping displays when no labels are present but namespaces exist - Respects existing resource name filters (no grouping when filtered) - Falls back to regular list view when neither labels nor namespaces are available Fixes feedback from Jonas (PR tilt-dev#6736): namespace grouping functions are now actually used and rendered in the UI. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
krishnactive
added a commit
to krishnactive/tilt
that referenced
this pull request
Apr 19, 2026
…OverviewTable This completes the UI integration for namespace grouping (Issue tilt-dev#6632): UI Components: - Added SidebarGroupedByNamespace component in SidebarResources.tsx for sidebar grouping - Added TableGroupedByNamespace component in OverviewTable.tsx for table grouping - Both components group resources by namespace with 'default' namespace shown first - Ungrouped resources (without namespace or Tiltfile) are shown separately SidebarItem Updates: - Added resource property to SidebarItem to enable namespace access during grouping - Allows UI components to extract namespace info directly from UIResource Display Logic: - Namespace grouping displays when no labels are present but namespaces exist - Respects existing resource name filters (no grouping when filtered) - Falls back to regular list view when neither labels nor namespaces are available Fixes feedback from Jonas (PR tilt-dev#6736): namespace grouping functions are now actually used and rendered in the UI.
27952a8 to
5595526
Compare
Complete implementation of Kubernetes namespace grouping in the UI: Backend Implementation: - Added Namespace field to UIResourceKubernetes struct - Implemented GetNamespace() method in K8sRuntimeState - Extract namespace from DeployedRefs in K8s resources - Updated UIResource conversion to populate namespace field Frontend Utilities: - Added getResourceNamespace() to extract namespace from resources - Added resourcesHaveNamespaces() to check if resources have namespace info - Added groupResourcesByNamespace() to group resources by namespace UI Component Integration: - Added SidebarGroupedByNamespace component for sidebar resource grouping - Added TableGroupedByNamespace component for table resource grouping - Both components display resources grouped by Kubernetes namespace - 'default' namespace shown first, others sorted alphabetically - Ungrouped resources (without namespace info) shown separately Display Logic: - Namespace grouping displays when no labels are present but namespaces exist - Respects resource name filters (no grouping when filtered) - Falls back to regular list view when neither labels nor namespaces available - Maintains full keyboard navigation and sorting support Technical Details: - Enhanced SidebarItem to store UIResource reference for namespace access - Updated TypeScript types in core.d.ts to include namespace field - Integrated gracefully with existing label-based grouping system
5595526 to
db9938b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Currently, resources in Tilt are not grouped by their Kubernetes namespace. This makes it difficult to:
Resources like Services and Ingress are lumped under "unlabeled" instead of being grouped with their namespace's Pods and Deployments.
Solution
Expose namespace information from Kubernetes resources and provide utilities to group resources by namespace in the UI.
Backend Changes
Namespacefield to expose the K8s namespaceGetNamespace()method to extract namespace from DeployedRefsFrontend Changes
getResourceNamespace()- Extract namespace from resourceresourcesHaveNamespaces()- Check if resources have namespace infogroupResourcesByNamespace()- Group resources by namespaceHow It Works
Example
After this change, resources will be organized like:
Files Changed
pkg/apis/core/v1alpha1/uiresource_types.go- Added namespace fieldinternal/store/runtime_state.go- Added GetNamespace() methodinternal/hud/webview/convert.go- Populate namespace in UIResourceweb/src/labels.ts- Added namespace grouping functionsweb/src/core.d.ts- Updated TypeScript typesTesting
Fixes #6632